package cn.kgc.controller;

import cn.kgc.pojo.Student;
import cn.kgc.service.StuService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * @author Rock
 * @create 2020-08-01 9:54
 */
@Controller
@RequestMapping(value = "/stu")
public class StuController {

    private StuService service;

    @RequestMapping(value = "/toList",method = RequestMethod.GET)
    public String toList(Model model) {
        List<Student> list = service.queryAll();
        model.addAttribute("list", list);
        return "stuList";
    }
}
